home *** CD-ROM | disk | FTP | other *** search
/ SGI Enlighten DSM 1.1 / SGI EnlightenDSM 1.1.iso / sco5x / common / bin / p_format < prev    next >
Text File  |  1998-07-01  |  2KB  |  80 lines

  1. #!/bin/sh
  2. #
  3. #   SID     @(#)p_format.sh    1.2 - 95/10/16
  4. #
  5. # Copyright (c) 1990-1998 Enlighten Software Solutions, Inc.
  6. #            -- All Rights Reserved --
  7. #
  8. #  created by: Thomas Kraus, February 8, 1994
  9. #
  10.  
  11. if test $# -lt 2
  12. then
  13.     echo "Usage: $0 architecture disk-device"
  14.     echo
  15.     echo "Where architecture is one of:"
  16.     echo "         AIX       SUN4"
  17.     echo "     SOLARIS         SCO"
  18.     echo "        HPUX        DGUX"
  19.     echo "        OSF1"
  20.     exit 1
  21. fi
  22.  
  23.  
  24. case "$1" in
  25. SOLARIS)
  26.     #
  27.     # SUN 4 and SOLARIS
  28.     #
  29.     trap "echo Procedure aborted; kill -9 0; exit 1" 1 2 3 6
  30.  
  31.     if test "$1" = "SOLARIS"
  32.     then
  33.         formatcmd=/usr/sbin/format
  34.     else
  35.         formatcmd=/usr/etc/format
  36.     fi
  37.  
  38.     echo
  39.     echo 
  40.     echo "The disk drive $2 will now be formated and verified. All"
  41.     echo "data on the disk will be lost and the formating of the disk"
  42.     echo "cannot be interupted."
  43.     echo
  44.     echo "    Do you wish to continue (y/n) ? \c"
  45.     read ans
  46.  
  47.     if test "$ans" = "y" -o "$ans" = "Y"
  48.     then
  49.         echo
  50.         echo "Starting to format disk in 10 seconds. Hit Ctrl-C to abort ..."
  51.  
  52.         for i in 1 2 3 4 5 6 7 8 9 0
  53.         do
  54.             echo ". \c"
  55.             sleep 1
  56.         done
  57.  
  58.         echo
  59.  
  60.         cmdfile=/tmp/._$$
  61.         echo format > $cmdfile
  62.         echo "Formating of disk is now beginning."
  63.         echo "The formating may take 20-40 minutes to complete ..."
  64.  
  65.         $formatcmd -f $cmdfile $2
  66.         exitval=$?
  67.  
  68.         echo
  69.         echo "Formating complete. To create partitions on the disk, proceed"
  70.         echo "to the Partitions screen and select the Modify button."
  71.  
  72.         rm -f $cmdfile
  73.     else
  74.         exitval=1
  75.     fi
  76.     ;;
  77. esac
  78.  
  79. exit $exitval
  80.